package com.bbm.controller;


import com.bbm.entity.vo.ResponseResult;
import com.bbm.service.HouseService;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

/**
 * (House)表控制层
 *
 * @author lionkliu
 * @since 2024-02-18 12:30:04
 */
@RestController
@RequestMapping("house")
public class HouseController {
    @Resource
    private HouseService houseService;


    @GetMapping("/list")
    public ResponseResult list() {
        return houseService.list();
    }

    @GetMapping("/{id}")
    public ResponseResult getHouseById(@PathVariable Integer id) {
        return houseService.getHouseById(id);
    }

    @GetMapping("/cate/{id}")
    public ResponseResult getByCategoryId(@PathVariable Integer id) {
        return houseService.getHouseByCategoryId(id);
    }
}
